﻿using System;

namespace Godot.modules.gdscript
{
    public partial class GDFunctions
    {
        public enum Function
        {
            MATH_SIN,
            MATH_COS,
            MATH_TAN,
            MATH_SINH,
            MATH_COSH,
            MATH_TANH,
            MATH_ASIN,
            MATH_ACOS,
            MATH_ATAN,
            MATH_ATAN2,
            MATH_SQRT,
            MATH_FMOD,
            MATH_FPOSMOD,
            MATH_FLOOR,
            MATH_CEIL,
            MATH_ROUND,
            MATH_ABS,
            MATH_SIGN,
            MATH_POW,
            MATH_LOG,
            MATH_EXP,
            MATH_ISNAN,
            MATH_ISINF,
            MATH_EASE,
            MATH_DECIMALS,
            MATH_STEPIFY,
            MATH_LERP,
            MATH_DECTIME,
            MATH_RANDOMIZE,
            MATH_RAND,
            MATH_RANDF,
            MATH_RANDOM,
            MATH_RANDSEED,
            MATH_DEG2RAD,
            MATH_RAD2DEG,
            MATH_LINEAR2DB,
            MATH_DB2LINEAR,
            LOGIC_MAX,
            LOGIC_MIN,
            LOGIC_CLAMP,
            LOGIC_NEAREST_PO2,
            OBJ_WEAKREF,
            TYPE_CONVERT,
            TYPE_OF,
            TEXT_STR,
            TEXT_PRINT,
            TEXT_PRINT_TABBED,
            TEXT_PRINTERR,
            TEXT_PRINTRAW,
            GEN_RANGE,
            RESOURCE_LOAD,
            INST2DICT,
            DICT2INST,
            PRINT_STACK,
            FUNC_MAX
        }

        protected static string[] func_names =
        #region ____func_names____
        {
            "sin",
		    "cos",
		    "tan",
		    "sinh",
		    "cosh",
		    "tanh",
		    "asin",
		    "acos",
		    "atan",
		    "atan2",
		    "sqrt",
		    "fmod",
		    "fposmod",
		    "floor",
		    "ceil",
		    "round",
		    "abs",
		    "sign",
		    "pow",
		    "log",
		    "exp",
		    "is_nan",
		    "is_inf",
		    "ease",
		    "decimals",
		    "stepify",
		    "lerp",
		    "dectime",
		    "randomize",
		    "randi",
		    "randf",
		    "rand_range",
		    "rand_seed",
		    "deg2rad",
		    "rad2deg",
		    "linear2db",
		    "db2linear",
		    "max",
		    "min",
		    "clamp",
		    "nearest_po2",
		    "weakref",
		    "convert",
		    "typeof",
		    "str",
		    "print",
		    "printt",
		    "printerr",
		    "printraw",
		    "range",
		    "load",
		    "inst2dict",
		    "dict2inst",
		    "print_stack",
        };
        #endregion

        public static string get_func_name(Function p_func)
        {
            if (!Enum.IsDefined(typeof(Function), p_func) || p_func.Equals(Function.FUNC_MAX))
                return "";

            return func_names[(int)p_func];
        }
    }
}
